import QtQuick 1.1
import com.meego 1.0
import "CommomUtil.js" as Util
import  "Article.js" as ArticleUtil

ToolBarLayout{
    id: container
    width: 480; height: 73

     property string replay_page :"http://sp.autohome.com.cn/Nokia/ReplyPageList.ashx?type=1&Id="

    ToolIcon{
        id: back_bt
        iconId: "toolbar-back"
        platformStyle: toolBar_style
        onClicked: {
            Util.back();//返回到文章列表
        }
    }

    ToolButton {
        id: comment_btn
        iconSource: "../images/articles/ico.png"
        width:comment_image.width; height: comment_image.height
        platformStyle: toolBar_style
        onClicked: {
           // ArticleUtil.setArticleId(articleContent_page.article_current_id);//传递值
            var doc = new XMLHttpRequest();
            doc.onreadystatechange = function() {
                if (doc.readyState == XMLHttpRequest.HEADERS_RECEIVED) {
                } else if (doc.readyState == XMLHttpRequest.DONE) {
                    var a = doc.responseXML.documentElement;

                     var pageNum=a.childNodes[1].childNodes[1].childNodes[0].nodeValue;

                     ArticleUtil.setReplyPageNum(pageNum); // 评论的页数

                     Util.openFile("ArticleReply.qml");
                }
            }
            doc.open("GET", replay_page+ArticleUtil.getArticleId());
            doc.send();
        }
    }

    ToolButtonStyle{
        id: toolBar_style
        backgroundVisible: false
        pressedBackground: "image://theme/meegotouch-button-navigationbar-button" + __invertedString + "-background-pressed"
    }
}
